/**
 * @file project_def.h
 * @brief 
 * @author wangh (wanghuan3037@fiberhome.com)
 * @version 1.0
 * @date 2021-03-01
 * @copyright Copyright (c) 2021  烽火通信
 */
#ifndef __PROJECT_DEF_H
#define __PROJECT_DEF_H 
#include <stdint.h>

#ifndef TYPEDEF_FLAOT_UNION
#define TYPEDEF_FLAOT_UNION
typedef union { uint8_t byte[4]; float value; } FLAOT_UNION;
#endif
#ifndef TYPEDEF_UINT32_UNION
#define TYPEDEF_UINT32_UNION
typedef union { uint8_t byte[4]; uint32_t value; } UINT32_UNION;
#endif
#ifndef TYPEDEF_INT32_UNION
#define TYPEDEF_INT32_UNION
typedef union { uint8_t byte[4]; int32_t value; } INT32_UNION;
#endif
#ifndef TYPEDEF_UINT16_UNION
#define TYPEDEF_UINT16_UNION
typedef union { uint8_t byte[2]; uint16_t value; } UINT16_UNION;
#endif
#ifndef TYPEDEF_INT16_UNION
#define TYPEDEF_INT16_UNION
typedef union { uint8_t byte[2]; int16_t value; } INT16_UNION;
#endif
#ifndef TYPEDEF_B32_UNION
#define TYPEDEF_B32_UNION
typedef union { uint8_t byte[4]; uint32_t uint32_value; int32_t int32_value; float float_value; } B32_UNION;
#endif
#ifndef TYPEDEF_B16_UNION
#define TYPEDEF_B16_UNION
typedef union { uint8_t byte[4]; uint16_t uint16_value; int16_t int16_value; } B16_UNION;
#endif


typedef int (*init_fn_t)(void);

#define INIT_EXPORT(fn, level)  const init_fn_t __init_##fn __attribute__((used,__section__(".fn_init." level))) = fn

#define INIT_BOARD_EXPORT(fn)       INIT_EXPORT(fn, "1")    ///< 芯片时钟、调试、操作系统等初始化
#define INIT_BSP_EXPORT(fn)         INIT_EXPORT(fn, "2")    ///< 外设驱动初始化
#define INIT_COMPONENT_EXPORT(fn)   INIT_EXPORT(fn, "3")    ///< 拓展组件初始化
#define INIT_APP_EXPORT(fn)         INIT_EXPORT(fn, "4")    ///< 应用模块初始化




#endif	 // __PROJECT_DEF_H 

/*********** (C) COPYRIGHT 2021 FiberHome *****END OF FILE****/
